package com.thinkgem.jeesite.modules.book.dao;

import com.thinkgem.jeesite.common.persistence.CrudDao;
import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
import com.thinkgem.jeesite.modules.book.entity.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 采购DAO接口
 * @author zc
 * @version 2014-05-16
 */
@MyBatisDao
public interface BookPurchaseDao extends CrudDao<BkPurchaseBatch>{
    int saveDetail(BkPurchaseBatchDetail detail);
    void saveDetails(@Param("details") List<BkPurchaseBatchDetail> details);

    List<BkPurchaseBatchDetail> findPurchaseBatchDetail(BkPurchaseBatchDetail detail);

    BkPurchaseBatchDetail findPurchaseBatchDetailByBkId(String bkId);

    void savePrice(@Param("batchId")int batchId, @Param("fixedPrice")double fixedPrice, @Param("discountedPrice")double discountedPrice);

    int deleteBatch(BkPurchaseBatch bkPurchaseBatch);

    int deleteDetail(BkPurchaseBatch bkPurchaseBatch);

    BkPurchaseBatchDetail getBatchDetailById(int pbdId);

    void updateDetail(BkPurchaseBatchDetail detail);

    void updateStatus(BkPurchaseBatch bkPurchaseBatch);

    void updateOtherWorkStatus();

    BkPurchaseBatch getCurrentWorkBatch(BkPurchaseBatch bkPurchaseBatch);

    int deleteDetailbyId(@Param("pbdId")String pbdId);

    void reducePurchase(@Param("pbdId") int pbdId, @Param("i") int i);

    void savePrint(@Param("startsn") String startsn, @Param("endsn") String endsn, @Param("school") String school);

    BkBookBan getMaxPrintbanId();

    int checkRepeatBatchNumber(String batchNumber);

    int saveStartBanId(@Param("startsn") String startsn, @Param("loginName") String loginName);

    List<BkBookBan> getPrintbanId(@Param("loginName") String loginName);

    int updateByBkId(BkBookinfo bookinfo);

    int updateStartBanId(@Param("startsn") String startsn, @Param("loginName") String loginName);
}